Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add database constraints to enforce unique version numbers #1538

Merged
merged 1 commit into from
Jun 11, 2022

Conversation

timobrembeck
Copy link
Member

@timobrembeck timobrembeck commented Jun 9, 2022

Short description

Ensure version numbers are unique for all content objects in each language.

Proposed changes

  • Add database UniqueConstraints for all content translation models
  • Adapt xliff test case because it is now failing due to the constraint

Resolved issues

My hope is that this is a quick temporary fix for #1518 and #1530 to make sure that at least the database integrity is preserved and an internal server error is thrown instead of creating duplicate translation versions.

@timobrembeck timobrembeck requested a review from a team as a code owner June 9, 2022 20:30
@timobrembeck timobrembeck force-pushed the enhancement/version-unique-constraint branch from 1a80449 to 1c34ae3 Compare June 9, 2022 22:40
@codeclimate
Copy link

codeclimate bot commented Jun 9, 2022

Code Climate has analyzed commit 1c34ae3 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 74.0% (0.0% change).

View more on Code Climate.

Copy link
Member

@ulliholtgrave ulliholtgrave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable and for my manipulated XLIFF this seems to work. I think we should merge this rather fast and bring this live

@timobrembeck timobrembeck merged commit 5caacf0 into develop Jun 11, 2022
@timobrembeck timobrembeck deleted the enhancement/version-unique-constraint branch June 11, 2022 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants